/**
 * @ author: 汪孟苹
 */
define(["jquery","template","oms_config/root",
	"scprit/followup/app/workBench/workBench.servers.js",
	"scprit/followup/template/workBench/workBench.tpl.js"],function($,template,$root,$workBenchServers,tpl){
	var ui = {};

	var drawBabyList = function(data){
		var config = $root.init();
		return template("tpl_" + config.tpl.workBenchBabyList,data);
	}
	var drawFirstName = function(data){
		return template("tpl_workBench_firstName",data);
	}
	var drawSelectQueue = function(data){
		return template("tpl_workBench_select",data);
	}
	var drawWindowPt = function(data){
		return template("tpl_workBench_bottomStatistics",data);
	}
	var drawWindowTop = function(data){
		return template("tpl_workBench_topStatistics",data);
	}
	var drawWindowRight = function(data){
		return template("tpl_workBench_operateList",data);
	}      
	/**
	 * 顶部和底部的统计
	 */
	ui.windowPtInit = function(options){
		$("#"+options.id).append(tpl.init6());
		var h = drawWindowPt(options.list);
		$("#"+options.id).append(h);
	}
	ui.windowTopInit = function(options){
		$("#"+options.id).html(tpl.init7());
		var h = drawWindowTop(options.list);
		$("#"+options.id).html(h);
	}
	/**
	 * 队列
	 */
	ui.selectQueueInit = function(options){
		var data = {
			rows:options.list
		}
		$("#"+options.id).html(tpl.init5());
		var h = drawSelectQueue(data);
		$("#"+options.id).html(h);
	}
	/**
	 * 今日门诊
	 */
	ui.windowRightInit = function(options){
		var data = {
			rows:options.list
		}
		$("#"+options.id).html(tpl.init8());
		var h = drawWindowRight(data);
		$("#"+options.id).html(h);
	}
	/**
	 * 窗口期随访患者
	 */
	ui.babyListInit = function(options){
		var data = {
			rows:$workBenchServers.babyListData(options.list,options.rows)
		};
		$("#"+options.id).html(tpl.init3());
		var h = drawBabyList(data);
		$("#"+options.id).html(h) ;
	}
	/**
	 * 姓初始化
	 */
	ui.firstNameInit = function(options){
		var data = {
			rows:$workBenchServers.firstNameData(options.list)
		};
		$("#"+options.id).html(tpl.init4());
		var h = drawFirstName(data);
		$("#"+options.id).html(h);
	}
	
	return ui;
});
